from api.services.user_service import UserService

class DataService:
    @staticmethod
    def login(username,password):
        """第一步数据处理"""
        # 这里实现具体的业务逻辑
        user = UserService.get_user_by_username(username)
        if user is None:
            return None
        return user
    
    @staticmethod
    def process_data_step2(data):
        """第二步数据处理"""
        # 这里实现具体的业务逻辑
        processed_data = data + " processed"
        return processed_data
    
    @classmethod
    def complex_data_processing(cls, data):
        """组合多个处理步骤的复杂业务逻辑"""
        step1_result = cls.process_data_step1(data)
        step2_result = cls.process_data_step2(step1_result)
        
        # 可以添加更多处理步骤...
        
        return step2_result